<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class BankCard extends Model
{   
    protected $table = 'bank_cards';
    //
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'user_id',
        'real_name',
        'idcard',
        'bank_name',
        'card_number',
        'province',
        'city',
        'area',
        'address',
        'accounts_bank',
        'status',
    ];

    public function status(){
        $status = ['未使用','已选择'];
        return $status[$this->status];
    }

    public function statuslabel(){
        $status = ['label-primary ','label-success','label-danger'];
        return $status[$this->status];
    }

    public function user(){
        return $this->belongsTo('App\User');
    }

}
